package com.ljy.my_study.java.时间轮;

import java.util.Random;

/**
 * @description:
 * @author: James
 * @create: 2022-04-16 19:23
 */
public class TestMain {



    public static void main(String[] args) {
        Random random=new Random();
        TimeRoundMonitor monitor=startMonitor();
        Runnable runnable=()->{
            System.out.println("runnable task execute...");
        };
        for(int i=0;i<10;i++){
            monitor.add(new Task(i+1,1,runnable,monitor));
        }
    }

    private static TimeRoundMonitor startMonitor(){
        TimeRoundMonitor monitor=new TimeRoundMonitor();
        monitor.start();
        return monitor;
    }

}
